package com.feeyin.radar.crm.dao.impl;

import com.feeyin.radar.crm.dao.ContractDetailTempDAO;
import com.feeyin.radar.crm.model.ContractDetail;
import java.util.List;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class ContractDetailTempDAOImpl extends SqlMapClientDaoSupport
  implements ContractDetailTempDAO
{
  public List getContractDetailTempsByContractId(Integer contractId)
  {
    if (contractId == null) return null;
    return getSqlMapClientTemplate().queryForList("getContractDetailTempsByContractId", contractId);
  }

  public boolean insertContractDetailTemp(ContractDetail contractDetail) {
    if (contractDetail == null) return false;
    Integer result = (Integer)getSqlMapClientTemplate().insert("insertContractDetailTemp", contractDetail);
    return result != null;
  }

  public boolean deleteContractDetailTempByContractId(Integer contractId)
  {
    if (contractId == null) return false;
    Integer result = Integer.valueOf(getSqlMapClientTemplate().delete("deleteContractDetailTempByContractId", contractId));
    return result != null;
  }
}